<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .my-block{
            background-color: royalblue;
            width: 50px;
            height: 50px;
        }
        .container1 {
            width: 300px;
            height: 300px;
            border: 1px solid red;
            display: grid;
            place-items: center;
        }
    </style>
</head>

<body>
    <div class="container1">
        <div class="my-block"></div>
    </div>
</body>

</html>